package com.xiaoc.bulldozer.common.model;

import java.io.Serializable;

/**
 * 功能
 *
 * @author CodeGenerator
 * @date 2014-05-21 13:56:58
 */
public class Action implements Comparable<Action>, Serializable {
    
    private static final long serialVersionUID = -7626387608206152628L;

    public static final int IS_MENU_YES = 1; // 是否是菜单

    public static final int ROOT_MENU = 0; // 顶级菜单ID
    
    public static final Integer ADMIN_SYSTEM = 1; // 后台系统
    
    /**
     * ID
     */
    private Integer id;
    
    /**
     * 功能名称
     */
    private String name;

    /**
     * 别名，给管理员看
     */
    private String aliasName;

    /**
     * 操作地址
     */
    private String url;
    
    /**
     * 是否菜单，1标识是，0标识否。
     */
    private Integer isMenu;
    
    /**
     * 父菜单ID
     */
    private Integer parentId;
    
    /**
     * 系统标识，1标识小鱼淘购管理后台
     */
    private Integer system;
    
    /**
     * 权重
     */
    private Integer weight;
    
    /**
     * 修改人
     */
    private Integer updateUser;
    
    /**
     * 修改时间
     */
    private Long updateTime;
    
    public Integer getId() {
        return id;
    }
        
    public void setId(Integer id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
        
    public void setName(String name) {
        this.name = name;
    }
    
    public String getUrl() {
        return url;
    }
        
    public void setUrl(String url) {
        this.url = url;
    }
    
    public Integer getIsMenu() {
        return isMenu;
    }
        
    public void setIsMenu(Integer isMenu) {
        this.isMenu = isMenu;
    }
    
    public Integer getParentId() {
        return parentId;
    }
        
    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }
    
    public Integer getWeight() {
        return weight;
    }
        
    public void setWeight(Integer weight) {
        this.weight = weight;
    }
    
    public Integer getUpdateUser() {
        return updateUser;
    }
        
    public void setUpdateUser(Integer updateUser) {
        this.updateUser = updateUser;
    }
    
    public Long getUpdateTime() {
        return updateTime;
    }
        
    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * @return the aliasName
     */
    public String getAliasName() {
        return aliasName;
    }

    /**
     * @param aliasName the aliasName to set
     */
    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    /**
     * @return the system
     */
    public Integer getSystem() {
        return system;
    }

    /**
     * @param system the system to set
     */
    public void setSystem(Integer system) {
        this.system = system;
    }

    @Override
    public int compareTo(Action action) {
        return this.weight.compareTo(action.getWeight());
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "Action [id=" + id + ", name=" + name + ", aliasName=" + aliasName + ", url=" + url + ", isMenu="
                + isMenu + ", parentId=" + parentId + ", system=" + system + ", weight=" + weight + ", updateUser="
                + updateUser + ", updateTime=" + updateTime + "]";
    }
    
}
